package com.zabra.zl.ui.godeal.tab.tab_choose;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.zabra.zl.R;
import com.zabra.zl.base.BaseMvpFragment;
import com.zabra.zl.ui.godeal.tab.tab_choose.contract.TabChooseContract;
import com.zabra.zl.ui.godeal.tab.tab_choose.presenter.TabChoosePresenter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class TabChoose extends BaseMvpFragment<TabChoosePresenter> implements TabChooseContract.View {
    @BindView(R.id.recycler)
    RecyclerView recycler;
    Unbinder unbinder;
    private List<String> list = new ArrayList<>();
    private Adp adp;

    @Override
    protected void initView(View view) {
        list.add("荣安地产");
        list.add("荣安地产");
        list.add("荣安地产");
        list.add("荣安地产");
        recycler.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
//        recycler.setNestedScrollingEnabled(false);
        adp = new Adp(R.layout.item_choose, list);
        recycler.setAdapter(adp);
        adp.openLoadAnimation();
        adp.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
            @Override
            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
                list.remove(position);
                adp.notifyItemRemoved(position);
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.tab_choose;
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void onError(Throwable throwable) {

    }

}
